﻿@{
    ViewBag.Title = "新增会议";
    Layout = "/Areas/WorkSpace/Views/Shared/_WorkSpace.cshtml";
}
<div id="content-header">
    <h1>
        新增会议</h1>
</div>
<div id="breadcrumb">
    <a href="/WorkSpace/Home" class="tip-bottom"><i class="icon-home"></i>起始页</a> <a
        href="/WorkSpace/Press">期刊管理</a> <a href="/WorkSpace/Press/MeetingsApply">会议管理</a>
    <a href="javascript:" class="current">新增会议</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-pencil"></i></span>
                    <h5>
                        新增会议</h5>
                    <h5 style="float: right; color: Red;">
                        *为必填</h5>
                </div>
                <div class="widget-content nopadding">
                    <form id="form-wizard" class="form-horizontal" method="post" enctype="multipart/form-data"
                    action="/WorkSpace/Press/NewMeeting">
                    <div id="form-wizard-1" class="step">
                        <div class="control-group">
                            <label class="control-label">
                                会议名称 (*)</label>
                            <div class="controls">
                                <input id="name" type="text" name="Name" class="{ required: true, minlength: 2, maxlength: 128, normalchat: true }" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                英文名 (*)</label>
                            <div class="controls">
                                <input id="name_en" type="text" name="Name_EN" class="{ required: true, minlength: 2, maxlength: 256, normalchat: true }" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                会议缩写 (*)</label>
                            <div class="controls">
                                <input id="shortname" type="text" name="ShortName" class="{required: true, minlength: 2, maxlength: 128, remote:{url:'/account/shortNameisOnly?type=2',message:'缩写重复，请更换'} }" />
                                <label>
                                    * 用于会议稿件编号，请认真填写</label>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                会议系列 (*)</label>
                            <div class="controls">
                                @{
                                    List<string> groupName = ViewBag.GroupName;
                                    string first = string.Empty;
                                    if (groupName != null && groupName.Any())
                                    {
                                        first = groupName.First();
                                    }
                                }
                                <input type="text" id="txtgroupName" name="GroupName" value="@first" class="{required:true}"/>
                                @if (groupName != null && groupName.Any())
                                {
                                    <select id="sltgroupName" onchange="setnewgroupname(this)">
                                        @{foreach (var item in groupName)
                                          {
                                            <option value="@item">@item</option>
                                          }
                                        }
                                    </select>     
                                }
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                会议关键字 (*)</label>
                            <div class="controls">
                                <input id="txtkeyword" type="text" name="Keyword" class="{required: true }" />
                                <label>
                                    * 用于会议检索，请认真填写</label>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                会议描述 (*)</label>
                            <div class="controls">
                                <input id="txtdescription" type="text" name="Description" class="{required: true }" />
                                <label>
                                    * 用于会议检索，请认真填写</label>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                行业分类 (*)</label>
                            <div class="controls">
                                <select id="sltIndType" name="IndType">
                                </select>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                编辑部邮箱 (*)</label>
                            <div class="controls">
                                <input id="txtEmail" type="text" name="Email" class="{required:true,email:true}" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                主办单位 (*)</label>
                            <div class="controls">
                                <input id="txtZBDW" type="text" name="ZBDW" class="{required:true}" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                会议Logo</label>
                            <div class="controls">
                                <input id="txtLogo" type="file" name="Logo" class="{required:true}" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">
                                个性化样式</label>
                            <div class="controls">
                                <textarea id="txtcss" name="Css" cols="20" rows="10"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="form-actions">
                        <input id="back" class="btn btn-primary" type="reset" />
                        <input id="next" class="btn btn-primary" type="submit" />
                        <div id="status">
                        </div>
                    </div>
                    <div id="submitted">
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@section tail
{
    <script type="text/javascript" src="/scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/scripts/unicorn.wizard.js"></script>
    <script type="text/javascript" src="/scripts/jquery.metadata.js"></script>
    <script type="text/javascript" src="/scripts/jquery.wizard.js"></script>
    <script type="text/javascript" src="/Scripts/plug.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#likmeeting').addClass('open active');
            $('#dtmeetingDate').datetimepicker({
                pickTime: false
            });
            $('#dtarticleEndDate').datetimepicker({
                pickTime: false
            });
            new plug.Control().BuildSelect({ element: 'sltIndType' }, 'profession');
        });
        function setnewgroupname(sender) {
            $('#txtgroupName').val($(sender).val());
        }
        function changeType(sender) {
            var type = $(sender).val();
            if (type == '1') {
                $('#sltIndType').val(0);
                $('#sltIndType').removeAttr('disabled');
            }
            else {
                $('#sltIndType').val(9999);
                $('#sltIndType').attr('disabled', 'disabled');
            }
        }
        function checkMember(sender) {
            if ($('#txtusername').val() == '') {
                return;
            }
            $.ajax({
                url: '/account/usernameonly',
                data: {
                    username: $('#txtusername').val()
                },
                cache: false,
                success: function (res) {
                    if (/true/i.test(res)) {
                        alert('该管理员账号可用');
                    }
                    else {
                        $('#txtusername').val('');
                        alert('该管理员账号已是本站会员，不可使用');
                    }
                }
            });
        }
    </script>
}
